package homework2;

import java.util.ArrayList;
import java.util.Random;

public class Mybox extends Thread{
	private String name;
	private Money a;
	private int total=0;
	private int count=0;
	private int max=0;
	public Mybox(Money money,String name) {
		this.name=name;
		this.a=money;
	}
	@Override
	public void run() {
		while(a.money.size()>=1){
			int m=a.choujiang(name);
			total+=m;
			count++;
			if(max<m){
				max=m;
			}
			try {
				Thread.sleep(10);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
	public int getMax() {
        return max;
    }

    public int getTotal() {
        return total;
    }

    public int getCount() {
        return count;
    }
}